name: Release Drafter

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, reopened, synchronize]

permissions:
  contents: read

jobs:
  update_release_draft:
    permissions:
      contents: write  # for release-drafter/release-drafter to create a github release
      pull-requests: write  # for release-drafter/release-drafter to add label to PR
    if: github.repository == 'testcontainers/testcontainers-java'
    runs-on: ubuntu-latest
    steps:
      - uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v5.19.0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
